﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Game
{
    /*-------------------------------------------------------------------------
    | Character:
    | ------------
    | Character
    |---------------------------------------------------------------------------*/
    public class Character : Moveable
    {
        public CharacterAction.ActionGroup Actions = null;

        public Character(Body body) : base(body)
        {
        }

        public override void OnUpdate(Events.ProcessUpdate evnt)
        {
            //check gnome is dead
            if (Body.GetPosition().y < -5)
            {
                IDK.Vector3 respawn = new IDK.Vector3(0, 10, 0);
                Body.Reset();
                Body.SetPosition(respawn);
            }

            if (Actions != null)
            {
                foreach (CharacterAction.Base it in Actions)
                {
                    it.Apply(this);
                }
            }

            base.OnUpdate(evnt);
        }
    }
}
